﻿<div class="left_col">

<!--            .............................................Main content area.......................................  -->
<?php
  // initiate all variables by calling the_post()
  the_post();
?>
<div class="post" id="post">


<!--   .......Title and author information area....... -->
<div class="title">

	<div class="candidate inline_block" style="float:right">
		<script type="text/javascript" src="//buetian-dot-com-theme-wordpress.googlecode.com/svn/Trunk/buetian4.0/customJS/fb.shareCountBtn.1.2.js"></script>
		<script type="text/javascript">
			jQuery().printFacebookShareButton({shareText:'Share'});
		</script>
	</div>

	<a href="javascript:location.reload(true);"><h1><?php the_title(); ?></h1></a>
	<div class="info" itemscope itemtype="http://data-vocabulary.org/Person">
	<h5>Written by: <?php
	// echo "<a href='"+ get_author_posts_url( get_the_author_meta( 'ID' ) ); the_author_meta('display_name') +"'>seoul</a>";
	$href= get_author_posts_url( get_the_author_meta( 'ID' ) );
	$title="view all post written by " . get_the_author_meta('display_name');
	$anchorBody= get_the_author_meta('display_name');
	echo "<a href='$href' title='$title'><span itemprop='name' itemprop='nickname'>$anchorBody</span></a>; ";

	$oauthPersonID = get_user_meta(get_the_author_meta( 'ID' ), 'loggedInViaGeneralOAuth');
	
	if( count($oauthPersonID) > 0)
	{
		try{
			parse_str($oauthPersonID[0], $params);
			if( $params['provider'] == 'facebook')
			{
				if( is_numeric($params['id']))
					$fburl = "https://www.facebook.com/app_scoped_user_id/". $params['id'];
				else
					$fburl = "https://www.facebook.com/" . substr($params['id'],1);
				echo "<a itemprop='url' href='$fburl' title='Facebook profile' target='_blank' class='externalurl' rel='author'>[Facebook]</a>";
			}
			else
				echo "<a itemprop='url' href='https://plus.google.com/u/0/{$params['id']}?rel=author' title='Google+ profile' target='_blank' class='externalurl' rel='author'>[Google+]</a>";
		}catch(Exception $e) { 
		//who cares? 
		}
	}
	?>
	</h5>

	<h5>
	<?php		
		// 06:21:26, 22-December-2011 = H:i:s j-F-Y
		//echo "Time: ". get_the_date("H:i a, j F, Y"). " [BST] " ;
		echo "on ". date("D, M j Y, G:i:s [T]", get_post_time('U', true));
	?>
	</h5>
	<div class="hidden"><span itemprop="role">লেখক</span> in <span itemprop="affiliation">বুয়েটিয়ান [BUETian.com]</span></div>
	</div> <!-- // info div ends here -->
</div>

<div class="clear"></div>

<!--            .............................................Post data content area.......................................  -->

<div class="mainContentSinglePost" id="mainContentSinglePost">
	<?php
	  the_content();
	?>
</div>

<!--            .............................................Related post+Category+Share this post: area.......................................  -->
<div class='clear'></div>

<h5 class="sectionHeader">সাইট লাইব্রেরী থেকে আরো কিছু পোস্ট</h5>
<div class="relatedPost">
		<!-- <strong> You maybe interested in these posts: </strong> -->
		<ul class="elementUL">
		<?php
			  //require_once '../customPhpScript/RelatedPost.php';
			  require_once get_absolute_template_path(). '/customPhpScript/RelatedPost.php';
			  $multipleTags= get_tags(); 
			  $relatedPost=new RelatedPost( get_the_category($post->ID), $multipleTags);
			  $relatedPost->execute();
			  $i=0;
			  foreach ($relatedPost->resultList as $value) {
					++$i; if( $i>7) break;
					echo '<li>' ;
					echo "<a href='{$value['href']}' title='{$value['title']}'>{$value['title']}</a>";
					echo '</li>';
			  }
		?>
		</ul>
		
		<ul class="elementUL">
			<?php
				if( is_single())
				{
					echo "<strong>Post category: </strong>";
					the_category(', ');
					the_tags(', ');
					wp_link_pages();
				}
				else if(is_page())
				{
					
				}
			?>
		</ul>
</div> <!--  # related post and category div ends here -->

<div class="clear"></div>

<?php comments_template(); ?>

</div> <!--  post content div ends here -->
</div>  <!-- left_col div ends here -->